<template>
  <div class="channel-member">
    <div class="header">
      <div class="header-background">
        <div class="header-background-title">总积分</div>
        <div class="header-background-content">{{info.credit.point}}</div>
      </div>
      <div class="header-info">
        <div class="header-info-detail">
          <ul>
            <li class="header-info-detail-header">现有积分</li>
            <li class="header-info-detail-content header-info-detail-content-color">{{info.credit.point-info.credit.redeemedPoint}}</li>
          </ul>
        </div>
        <div class="header-line-vertical"></div>
        <div>
          <ul>
            <li class="header-info-detail-header">已返现积分</li>
            <li class="header-info-detail-content">{{info.credit.redeemedPoint}}</li>
          </ul>
        </div>
      </div>
    </div>
    <div v-if="info.mermberList.length > 0">
      <div class="content" v-for="member in info.mermberList">
        <div class="item-header">
          <div class="icon-name">{{member.username}} <span class="icon-phone">{{member.phone}}</span></div>
          <div class="item-obtain">返现比例
            <div class="item-obtain-amount">{{member.proportion}}%</div>
          </div>
        </div>
        <div class="team-container bottom-border">
          <div>
            <ul>
              <li class="team-detail-header">订单数</li>
              <li class="team-detail-content">{{member.orderNum}}</li>
            </ul>
          </div>
          <div class="item-line-vertical"></div>
          <div>
            <ul>
              <li class="team-detail-header">购买金额</li>
              <li class="team-detail-content">{{member.amount}}</li>
            </ul>
          </div>
          <div class="item-line-vertical"></div>
          <div>
            <ul>
              <li class="team-detail-header">获得积分</li>
              <li class="team-detail-content">{{member.credit}}</li>
            </ul>
          </div>
        </div>
        <div class="item-detail" @click="memberOrder(member.userId,member.username)">查看详情</div>
      </div>
    </div>
    </body>
  </div>
</template>
<script>
import { wxshare } from 'common/mixin';
import { mapActions } from 'vuex';

export default {
  mixins: [wxshare],
  data() {
    return {
      info: {
        credit: {},
        mermberList: [],
      }
    }
  },
  methods: {
    ...mapActions({
      getNewMemberInfo: 'GetNewMemberInfo',
    }),
    memberOrder(id, name) {
      let title = name;
      this.$router.push({ path: '/channel/doctorList', query: { userId: id, name: title } });
    }
  },
  mounted() {},
  created() {
    this.getNewMemberInfo().then(data => {
      this.info = data;
    }).catch(msg => {

    })
  },

}

</script>
<style lang="less">
.channel-member {

  .header {
    width: 100%;
    height: 8rem;
    background: #549EEF;
    background-image: linear-gradient(-90deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.40) 100%);
  }

  .header-background {
    text-align: center;
    padding-top: 1rem;
    color: rgba(255, 255, 255, 0.60);
  }

  .header-background-title {
    height: 1rem;
    line-height: 1rem;
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.60);
  }

  .header-background-content {
    line-height: 1;
    font-size: 1.25rem;
  }

  .header-info {
    margin-top: 0.8rem;
    display: flex;
    text-align: center;
    justify-content: space-around;
  }


  .header-info-detail-header {
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.6);
  }

  .header-info-detail-content {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: rgba(243, 249, 253, 0.6)
  }


  .header-info li:first-child {
    margin-bottom: 0.25rem;
  }

  .header-line-vertical {
    width: 0.05rem;
    height: 2rem;
    background: rgba(229, 243, 253, 0.6);
  }


  .content {
    width: 17rem;
    background: #FFFFFF;
    box-shadow: 0 0.5rem 1rem 0 rgba(0, 0, 0, 0.10);
    margin-top: 0.75rem;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0.25rem;
    border: 0.05rem solid rgba(32, 67, 106, 0.2);
    color: #20436A;
  }

  .item-detail {
    width: 9rem;
    height: 2rem;
    line-height: 2rem;
    margin: 0.9rem auto;
    border-radius: 1rem;
    text-align: center;
    background-image: linear-gradient(-90deg, #75B0F1 0%, #75D0F1 100%);
    box-shadow: 2px 2px 8px 0 rgba(117, 176, 241, 0.60);
    color: rgba(255, 255, 255, 1)
  }

  .item-header {
    display: flex;
    justify-content: flex-start;
    line-height: 2.35rem;
    border-bottom: 1px solid #E3E9EC;
    position: relative;
  }

  .icon-name {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    font-weight: bold;
  }
  .icon-phone {
    font-size: 0.7rem;
    color: rgba(14, -2147483648, -2147483648, 0.60);
    line-height: 25px;
  }
  .item-obtain {
    right: 0.5rem;
    position: absolute;
    font-size: 0.6rem;
    height: 2.35rem;
    line-height: 2.35rem;
    color: #9B9B9B;
  }

  .item-obtain-amount {
    display: inline-block;
    font-size: 0.9rem;
    padding-left: 0.25rem;
    color: #20436A;
  }

  .team-container {
    display: flex;
    text-align: center;
    justify-content: space-around;
    height: 3rem;
  }

  .team-detail {
    width: 7.25rem;
    height: 2rem;
    line-height: 2rem;
    margin: 0.9rem auto;
    border-radius: 1rem;
    text-align: center;
    background-image: linear-gradient(-90deg, #75B0F1 0%, #75D0F1 100%);
    box-shadow: 2px 2px 8px 0 rgba(117, 176, 241, 0.60);
    color: rgba(255, 255, 255, 1);
    float: left;
  }


  .bottom-border {
    margin: 0.1rem auto 0;
    width: 96%;
    border-bottom: 1px solid #E3E9EC;
  }

  .qudao-team-detail {
    width: 40%;
    height: 2rem;
    line-height: 2rem;
    margin: 0.9rem auto;
    border-radius: 1rem;
    text-align: center;

    box-shadow: 2px 2px 8px 0 rgba(117, 176, 241, 0.60);
    color: rgba(255, 255, 255, 1);
  }

  .qudao-team-detail-left {
    float: left;
    margin-left: 5%;
    background-image: linear-gradient(-90deg, #75B0F1 0%, #75D0F1 100%);
  }

  .qudao-team-detail-right {
    float: right;
    margin-right: 5%;
    background-image: linear-gradient(-90deg, #FB6B10 0%, #FFB208 100%);
  }

  .team-detail-suffix {
    font-size: 0.9rem;
    color: #4A4A4A;
    width: 5.1rem;
  }

  .team-detail-header {
    font-size: 0.6rem; // color: #9B9B9B;
    margin-bottom: 0.25rem;
    margin-top: 0.6rem;
  }

  .team-detail-content {
    font-size: 0.9rem;
    color: #000000;
  }

  .item-line-vertical {
    width: 0.05rem;
    height: 1.2rem;
    background: #9b9b9b;
    margin-top: 0.9rem;
  }

  .content-2 {
    height: 7rem;
    margin-bottom: 2rem;
  }

  .border-bottom-solid {
    border-bottom: 1px solid #E3E9EC;
  }

  .submit-container {
    margin-top: 0.9rem;
    text-align: center;
  }

  .submit-image {
    width: 16rem;
    height: 3.75rem;
  }
}

</style>
